package com.atguigu.gulimall.order.constant;

public class OrderConstant {
    public static final String USER_ORDER_TOKEN_PREFIX = "order:token:";
    public static final String ORDER_EVENT_EXCHANGE = "order-event-exchange";

    public static final String ORDER_CREATE_ORDER_ROUTING = "order.create.order";
    public static final String ORDER_PAY_ORDER_ROUTING = "order.pay.order";
    public static final String ORDER_RELEASE_OTHER_ROUTING = "order.release.other";
    public static final String REDIS_SCRIPT="if redis.call('get',KEYS[1]) == ARGV[1] then return redis.call('del',KEYS[1]) else return 0 end";

    public static final Integer autoConfirmDay = 7;
    public static final Integer noDeleteStatus=0;
    public static final Integer deleteStatus=1;

    public static final String ORDER_MSG_FAIL_1= "下单失败,订单信息过去,请刷新再提交";
    public static final String ORDER_MSG_FAIL_2= "下单失败,订单商品价格发生变化，请确认后再次提交";
    public static final String ORDER_MSG_FAIL_3= "下单失败,订单商品库存不足，请确认后再次提交";

    /**
     * 订单状态枚举
     */
    public enum OrderStatusEnum {
        CREATE_NEW(0,"待付款"),
        PAYED(1,"已付款"),
        SENDED(2,"已发货"),
        RECIEVED(3,"已完成"),
        CANCLED(4,"已取消"),
        SERVICING(5,"售后中"),
        SERVICED(6,"售后完成");
        private Integer code;
        private String msg;

        OrderStatusEnum(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public Integer getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }
}
